﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SmartApplication.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class nj : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "HealthType",
                table: "FeedModel");

            migrationBuilder.DropColumn(
                name: "HealthWay",
                table: "FeedModel");

            migrationBuilder.AddColumn<long>(
                name: "HealthId",
                table: "FeedModel",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.CreateTable(
                name: "health",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    FeedDays = table.Column<int>(type: "int", nullable: false),
                    HealthType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    HealthWay = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_health", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "health");

            migrationBuilder.DropColumn(
                name: "HealthId",
                table: "FeedModel");

            migrationBuilder.AddColumn<string>(
                name: "HealthType",
                table: "FeedModel",
                type: "varchar(100)",
                maxLength: 100,
                nullable: false,
                defaultValue: "")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "HealthWay",
                table: "FeedModel",
                type: "varchar(200)",
                maxLength: 200,
                nullable: false,
                defaultValue: "")
                .Annotation("MySql:CharSet", "utf8mb4");
        }
    }
}
